//
//  NSTableView+Extensions.m
//  CantripSDK
//
//  Created by James Callender on Wed Jun 16 2004.
//  Copyright (c) 2004 James Callender. All rights reserved.
//

#import "NSTableView+Extensions.h"


@implementation NSTableView (CantripSDKExtensions)

- (NSMenu *)menuForEvent:(NSEvent *)evt
{
    NSPoint pt=[self convertPoint:[evt locationInWindow] fromView:nil];
    int column=[self columnAtPoint:pt],row=[self rowAtPoint:pt];
    if (column>=0 && row>=0 && [[self delegate] respondsToSelector:@selector(menuForTableColumn:row:)])
	return [[self delegate] menuForTableColumn:[[self tableColumns] objectAtIndex:column] row:row];
    return nil; 
}

@end
